package com.chen.controller;


import com.chen.pojo.Type;
import com.chen.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.List;

@Controller
@RequestMapping("/type")
public class TypeController {

    //组合service
    @Autowired
    private TypeService typeService;

    //所有的类型信息
    @RequestMapping("all")
    public String allType(Model model){
        List<Type> types = typeService.allType();

        model.addAttribute("types",types);
        return "/admin/allType";
    }
}
